const { SHORTSTRING, STRING, LONGSTRING, INTEGER } = require('../types')

module.exports = (sequelize, DataTypes) => {
  const passenger = sequelize.define(
    'passenger',
    {// 在这里定义模型属性
      id: {
        type: INTEGER,
        primaryKey:true,
        autoIncrement:true,
        allowNull:false
      },
      userid: { // 外键：用户id
        type: INTEGER,
      },
      realname: { // 真实姓名
        type: SHORTSTRING,
      },
      self: { // 本人
        type: SHORTSTRING,
      },
      cardtype: { // 证件类型
        type: SHORTSTRING,
      },
      cardno: { // 证件号码
        type: STRING,
      },
      pType: { // 乘客类型
        type: SHORTSTRING,
      },
      examine: { // 非成人类型的验证
        type: SHORTSTRING,
      },
      choose: { // 乘车人是否已选择
        type: SHORTSTRING,
      },
      phone: { // 手机号
        type: SHORTSTRING,
      },
      pics: { // 认证照片
        type: LONGSTRING,
      }
    }, 
    {
    tableName: "passenger",//直接提供表名
    timestamps: false,
   }
  );
  return passenger
}
